import request from '@/utils/request'

//商品服务的基础地址前缀
const BASE_URL = '/product-api'

/**
 * 获取品牌关联的分类列表
 * @param params
 * @param brandId
 * @returns {AxiosPromise}
 */
export function relationList(pageNo, pageSize, brandId) {
  return request({
    url: `${BASE_URL}/productCategoryBrandRelation/list/${brandId}`,
    method: 'get',
    params: { pageNo, pageSize }
  })
}

/**
 *批量新增关联
 * @param {*} data
 * @returns
 */
export function batchSaveRelation(data) {
  return request({
    url: `${BASE_URL}/productCategoryBrandRelation/batchSaveRelation`,
    method: 'post',
    data: data
  })
}

/**
 * 批量删除关联
 * @param {*} data
 * @returns
 */
export function removeRelation(id) {
  return request({
    url: `${BASE_URL}/productCategoryBrandRelation/removeRelation/${id}`,
    method: 'delete'
  })
}
